package com.gameLogic.actor
{
	import laya.display.Sprite;
	import laya.maths.Point;
	import laya.utils.Tween;

	public class Player
	{
		
		protected var _disObj:Sprite;
		
		public function get disObj():Sprite
		{
			return _disObj;
		}
		
		public function Player()
		{
			_disObj = new Sprite();
			var spr:Sprite = Sprite.fromImage("../../res/player.png");
			spr.x = spr.y = -48;
			_disObj.addChild(spr);
		}
		
		private var _tween:Tween;
		public function moveTo(pos:Point):void
		{
			if(_tween)
				_tween.clear();
			_tween = Tween.to(_disObj, {x:pos.x, y:pos.y}, 1000);
		}
		
		
		private static var _instance:Player
		public static function get instance():Player
		{
			if(!_instance){ _instance = new Player(); }
			return _instance;
		}
		
	}
}